#ifndef DB_H
#define DB_H
#include "mysql/mysql.h"
#include <mutex>
#include <QDebug>
#include "json.hpp"
#include <iostream>
using namespace std;
using json = nlohmann::json;
class DB
{
public:
    DB(const char*host,const char*username,const char*password,const char*dbname);
    bool db_exec(const char*sql);
    bool db_select(const char*sql,json &j);
private:
    MYSQL*mysql;
    std::mutex mutex;
};

#endif // DB_H
